package com.myspring.controller;

import com.myspring.entity.Article;
import com.myspring.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = {"/mycontroller5"})
public class MyController5 {
    @Autowired
    private MyService myService;

    @RequestMapping(value = "/mymethod5/{id}")
    public ResponseEntity<Article> mymethod3 (@PathVariable(value="id") Integer id) throws  Exception{
        return new ResponseEntity<Article>(myService.queryArticleById2(id), HttpStatus.OK);
    }
}
